package com.hz.framework.ajax;

import java.util.HashMap;
import java.util.Map;

public class AjaxSQL {
	/**
	 * hql语句
	 * */
	public static final String doAjaxSQL(String arg0){
		
		Map<String, String> mAjaxSQL = new HashMap<String, String>();
		
//		供应商信息
		mAjaxSQL.put("ST01", "select * from pres_supplier where 1 = 1 ");
//		原材料信息
		mAjaxSQL.put("ST02", "select * from pres_makings where 1 = 1 ");
		
		
		mAjaxSQL.put("HF02", "select depid,depname from Hzsysorganization where 1 = 1 ");
		mAjaxSQL.put("HF03", "select depid,depname from Hzsysorganization where 1 = 1 and depid not in (select posid from Hzsysempholdpost where perid = ");
		mAjaxSQL.put("EM01", "select new map(p.personid as personid, p.personname as personname, p.sex as sex, dp.depname as posid, dd.depname as deptid,p.mobiletelephone as mobiletelephone,p.telephone as telephone) from Hzsyspersonnel p left join p.posid dp left join p.deptid as dd where 1=1");
		mAjaxSQL.put("EM02", "select new map(p.personid as personid, p.personname as personname, p.sex as sex, dp.depname as posid, dd.depname as deptid,p.mobiletelephone as mobiletelephone,p.telephone as telephone) from Hzsyspersonnel p left join p.posid dp left join p.deptid as dd where 1=1 and (p.posid is null or p.posid='') ");
		mAjaxSQL.put("EM03", "select p.personid as personid, p.personname as personname from Hzsyspersonnel p where 1=1 ");
		//为系统设定统计提供下拉框信息
		mAjaxSQL.put("MU01", "select id,name from dzjcweb.dbo.NotePerson where 1=1");
		mAjaxSQL.put("MU02", "select sm.id,sm.staname from statics_model as sm,base_relation as br where br.relevancy = sm.relateflag and relesort='sta' ");

//		节日列表
		mAjaxSQL.put("FD01", "select new map(f.fid as fid, f.fname as fname, f.fdate as fdate, f.fvalue as fvalue, f.ftype as ftype,f.fcalendar as fcalendar,f.remind as remind) from Festival f where 1=1 ");
//		特殊日期列表
		mAjaxSQL.put("CD01", "select new map(c.calId as calId, c.calname as calname, c.caldate as caldate, c.calflag as calflag, c.CDate as CDate,c.userid as userid,c.remark as remark,c.calremind as calremind) from Calendars c where 1=1 ");
		//数据项编辑页面中的取外部表单数据项
		mAjaxSQL.put("dataeditthat", "select new map(columnch as columnc,columnen as columne) from HzDataValue ");
		//select DFID,NAME_CN from HZ_DOC_DEF_DATA 
		//根据流程查询出对应的表单信息
		mAjaxSQL.put("dataeditBase", "select new map(nameCn as columnc,dfid as columne) from HzDocDefBasic ");
		//根据表单信息查询出数据项信息
		mAjaxSQL.put("dataeditData", "select new map(nameCn as columnc,nameObject as columne) from HzDocDefData ");
//		根据表单信息查询出数据项信息
		mAjaxSQL.put("BaseNameEn", "select name_en from HZ_DOC_DEF_BASIC ");
		
		
		mAjaxSQL.put("datalist","select new map(flowid as flowid,dfid as dfid,dtid as dtid," +
				"nameCn as nameCn,nameObject as nameObject,nameType as nameType," +
				"nameValue as nameValue,isvalid as isvalid,iscreate as iscreate," +
				"superitem as superitem,property as property) from HzDocDefData where ");
		return mAjaxSQL.get(arg0).toString();
	}
}
